<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <include file="./Application/Admin/View/block/easyui_header.php" />
    <style>
        .window{
            display: block;
        }
        .form-table tr{
            height: 35px;
            line-height: 35px;;
        }
    </style>
</block>
<block name="bdoy">
    <body>

    <div id="window" class="easyui-window" title="导出月报表" data-options="modal:true" style="width:300px;height:150px;padding:0px;overflow: hidden;">
        <form id="form">
            <table class="form-table">
                <tr>
                    <td width="100" align="center">需要导出日期：</td>
                    <td>
                        <select id="start_year" class="easyui-validatebox" data-options="required:true">
                            <option></option>
                            <option value="2018">2018年</option>
                            <option value="2017">2017年</option>
                            <option value="2016">2016年</option>
                            <option value="2015">2015年</option>
                            <option value="2014">2014年</option>
                        </select>
                    </td>
                    <td>
                        <select id="start_month" class="easyui-validatebox" data-options="required:true">
                            <option></option>
                            <option value="01">1月</option>
                            <option value="02">2月</option>
                            <option value="03">3月</option>
                            <option value="04">4月</option>
                            <option value="05">5月</option>
                            <option value="06">6月</option>
                            <option value="07">7月</option>
                            <option value="08">8月</option>
                            <option value="09">9月</option>
                            <option value="10">10月</option>
                            <option value="11">11月</option>
                            <option value="12">12月</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td align="center" colspan="2">
                        <a href="javascript:export_excel()" class="easyui-linkbutton" style="width:120px">{:LANG('export')}</a>
                    </td>
                </tr>
            </table>
        </form>
        <input type="hidden" id="end_date"/>
    </div>

    </body>
</block>
<block name="footExtendJs">
    <script>
        var start_date;
        var end_date;

        function export_excel(){
            if(!$('#form').form('validate')){
                return;
            }
            var year = $('#start_year').val();
            var month = $('#start_month').val();
            start_date = year+'-'+month+'-01 00:00:00';
            end_date =  year+'-'+month+'-01 11:59:59';
            var url = '/Manage/Export/export_excel?';
            console.log(start_date);
            console.log(end_date);
            window.open(url+'start_date='+start_date+'&&end_date='+end_date);
        }
    </script>


</block>
